Towards Partial Evaluation of Full Scheme
نویسنده
چکیده
We present a binding-time analysis for Scheme which enables an ooine partial evaluator to successfully treat Scheme's reeective features eval, apply, and the control operator call/cc. Additionally, our analysis empowers the specializer to select the most eecient representation for each object. This removes some limitations of previous specializers regarding the use of higher-order functions. The theoretical development is backed by an implementation. features, meta-computation The programming language Scheme 20] is an ideal vehicle for meta-computation, speciically for partial evaluation. Part of the appropriateness of Scheme for meta-computation tasks derives from its reeective features: eval 27], which reeects the external representation of, say, a procedure to a functional value, apply, which reeects lists to argument lists, and call/cc 1 , which makes the continuation of the current expression available as a procedure. The continuation can be viewed as a reiied object from the meta-interpreter (supposedly written in CPS). Much work in partial evaluation has been done in the context of Scheme 3, 6, 7, 5, 8]. However, its reeective features have been neglected so far. In order to overcome this drawback, we present a binding-time analysis and a specialization algorithm for a large functional subset of Scheme. The subset includes eval, apply, and call/cc. Additionally, our new analysis supports vari-adic functions and includes a representation analysis which treats external and built-in operators more liberal than previous analyses. The latter analysis improves the eeciency of the specializer by enabling it to choose most eecient representations for functions and other partially static data. To the best of our knowledge , these features are unique to our work. Overview In the following section we brieey review ooine partial evaluation. We assume some familiarity with partial evaluation 21] and with type-based binding-time analysis (e.g., 15, 16, 18, 7]). In Sec. 2, we present two applications|parser generation and exception handling|which beneet from a partial evaluator capable of dealing with eval, apply, and call/cc. Section 3 informally explains the specializer's treatment of these reeective operators. In Sec. 4 we present the formal development of our binding-time analysis in a type-based framework. We brieey discuss automatic type reconstruction for the underlying type system in 1 Scheme calls it call-with-current-continuation. Partial evaluation is a program specialization technique which is based on aggressive constant propagation. The aim of specialization is improving eeciency: Given a source program and the static (known) part of its input , construct a residual program which …
منابع مشابه
Partial Knowledge in Multiple-Choice Testing
The intent of this study was to discover the nature of (partial) knowledge as estimated by the multiple-choice (MC) test method. An MC test of vocabulary, including 20 items, was given to 10 participants. Each examinee was required to think aloud while focusing on each item before and while making a response. After each test taker was done with each item, s/he was ...
متن کاملThe Stability of Non-standard Finite Difference Scheme for Solution of Partial Differential Equations of Fractional Order
Fractional derivatives and integrals are new concepts of derivatives and integrals of arbitrary order. Partial differential equations whose derivatives can be of fractional order are called fractional partial differential equations (FPDEs). Recently, these equations have received special attention due to their high practical applications. In this paper, we survey a rather general case of FPDE t...
متن کاملA Compact Scheme for a Partial Integro-Differential Equation with Weakly Singular Kernel
Compact finite difference scheme is applied for a partial integro-differential equation with a weakly singular kernel. The product trapezoidal method is applied for discretization of the integral term. The order of accuracy in space and time is , where . Stability and convergence in norm are discussed through energy method. Numerical examples are provided to confirm the theoretical prediction ...
متن کاملApplication of high-order spectral method for the time fractional mobile/immobile equation
In this paper, a numerical efficient method is proposed for the solution of time fractional mobile/immobile equation. The fractional derivative of equation is described in the Caputo sense. The proposed method is based on a finite difference scheme in time and Legendre spectral method in space. In this approach the time fractional derivative of mentioned equation is approximated by a scheme of ord...
متن کاملIsolation and characterization of Brachyspira species based on biochemical scheme and 16S rDNA partial sequencing
Avian intestinal spirochetosis (AIS) is a disease of birdscharacterized by a marked colonization of the cecum and/or rectumwith anaerobic intestinal bacteria of the genus Brachyspira. Thepurpose of the study was to determine the occurrence of Brachyspiraspp from avian sources in Iran and to characterize selected isolates bybiochemical and molecular methods. Out of 165 fecal samples obtained fro...
متن کامل